const state = {
    aboutList: localStorage.getItem('aboutList') !== undefined ? JSON.parse(localStorage.getItem('aboutList')) : {},
}
console.log()

const mutations = {
    SET_ABOUT(state, val) {
        state.aboutList = val
        localStorage.setItem('aboutList', JSON.stringify(val))
    }
}

const actions = {
    /**
     * 设置 任务管理 中的 aboutList
     * @param commit
     * @param val
     * @returns {Promise<unknown>}
     */
    setAboutList({commit}, val) {
        return new Promise(resolve => {
            setTimeout(() => {
                commit('SET_ABOUT', val)
                resolve()
            }, 1000)
        })
    }
}

const getters = {
    aboutList: (state) => state.aboutList
}


export default {
    namespaced: true,
    state,
    mutations,
    actions,
    getters
}
